package com.zhike.service.messages;

import java.util.List;

import com.zhike.common.dto.MsgBodyRoot;
import com.zhike.common.dto.OfflineMsgDTO;
import com.zhike.common.dto.RevokedDTO;
import com.zhike.common.model.Device;
import com.zhike.mobileimsdk.server.protocal.Protocal;

public interface IMessagesService {
    /**
     * 根据fingerPrint查询是否有离线消息
     *
     * @param fingerPrint fingerPrint
     * @return 结果
     */
    Integer queryOfflineHistoryCountByFingerPrint(String fingerPrint);

    /**
     * 新增临时聊天消息
     *
     * @param fromUid         fromUid
     * @param toUid           toUid
     * @param msgType         msgType
     * @param message         message
     * @param messageContent2 messageContent2
     * @param historyTime2    historyTime2
     * @param chatType        chatType
     * @param groupId         groupId
     * @param parentFp        parentFp
     * @return 结果
     */
    Boolean insertOfflineHistoryData(String fromUid, String toUid,
            String msgType, String message, String messageContent2, String historyTime2,
            Integer chatType, String groupId, String parentFp);

    /**
     * 获取离线聊天消息的接口
     *
     * @param isIncludeFingerPring isIncludeFingerPring
     * @param fromUserUid          fromUserUid
     * @param userUid              userUid
     * @return 结果
     */
    List<OfflineMsgDTO> getOfflineFriendsMessages(Boolean isIncludeFingerPring, String fromUserUid, String userUid);

    /**
     * 删除离线列表消息
     *
     * @param userUid     userUid
     * @param fromUserUid fromUserUid
     * @return 结果
     */
    Boolean deleteOfflineHistoryByFriendUserUid(String userUid, String fromUserUid);

    /**
     * 撤销消息
     * 
     * @param uid
     * @param dto
     * @return
     */
    Boolean revokeMessage(String uid, RevokedDTO dto);

    /**
     * 单聊 仅测试
     * 
     * @param deviceId
     * @param fp
     * @param dataJson
     * @throws Exception
     */
    void sendMessageToClient(String deviceId, String fp, MsgBodyRoot dataJson) throws Exception;

    /**
     * 群聊 仅测试
     * @param fp
     * @param dataJson
     */
    void sendMessageToGroup(String fp, String dataJson);
}